import request from '@/utils/request'
// 商品搜索
export const goodsSearch = ({ pageIndex, pageSize, skuName, classId }) => {
  return request({
    url: `/api/vm-service/sku/search`,
    params: {
      pageIndex, pageSize, skuName, classId
    }
  })
}
// 商品类型搜索
export const goodsTypeSearch = ({ pageIndex, pageSize, className }) => {
  return request({
    url: `/api/vm-service/skuClass/search`,
    params: {
      pageIndex, pageSize, className }
  })
}
// 新增商品类型
export const addSl = (className) => {
  return request({
    url: `/api/vm-service/skuClass`,
    method: 'POST',
    data: className
  })
}
// 修改商品类型
export const modifySpApi = (classId, className) => {
  return request({
    url: `/api/vm-service/skuClass/${classId}`,
    method: 'PUT',
    data: className
  })
}
// 删除商品类型
export const delTypeApi = (classId) => {
  return request({
    url: `/api/vm-service/skuClass/${classId}`,
    method: 'DELETE'

  })
}
// 新增商品
export const addGoods = (data) => {
  return request({
    url: `/api/vm-service/sku`,
    method: 'POST',
    data

  })
}
// 修改商品
export const modifyGoods = (skuId, data) => {
  return request({
    url: `/api/vm-service/sku/${skuId}`,
    method: 'PUT',
    data
  })
}
// 获取销售前几的商品
export const goodsTop = (topValue, start, end) => {
  return request({
    url: `/api/order-service/report/skuTop/${topValue}/${start}/${end}`
  })
}
